1. Field of the Invention
The present invention relates to an image processing apparatus configured to estimate a light source and to perform appropriate white balance control according to the estimated light source, and a method thereof.
2. Description of the Related Art
Recent video cameras (camcorders) perform automatic white balance control using an output from an image sensor instead of using an external sensor. For example, a video camera obtains color-difference signals (R-Y and B-Y) and a luminance signal (Y) from red (R), green (G), and blue (B) color signals. The video camera divides image data into a plurality of blocks and obtains a mean value of the signals for each divided block. The video camera then extracts a color signal component close to white from the mean value of each divided block and performs control such that a mean value of the extracted color signal component close to white reaches a target white color (see Japanese Patent Application Laid-Open No. 05-64219).
When a video camera performs automatic white balance control on a moving image as described above, a drastic change in white balance may cause an unnatural video image. Consequently, a white balance gain needs to be changed gradually with time. Therefore, in the case of a moving image, it is more appropriate to adjust the white balance control by performing a feedback control. The feedback control uses color data that have been amplified with white balance control such that the white balance can be controlled after confirming the control result.
The white extraction method described above extracts a green color of fluorescent light as white, and thus the green color region is included in the white extraction range. As a result, the green color of a turf or a tree is extracted as white and is adjusted to become closer to the target white color, so that an image of the turf or the tree may become discolored.
Japanese Patent Application Laid-Open No. 08-79786 discusses a method for extracting white color more accurately. The discussed method detects a green color signal from signals included in the white extraction range and performs control such that a green signal of low luminance will not be easily extracted as a white color signal. As a result, the green color of low luminance in objects, such as a turf or a tree, is not extracted as white and is not discolored by the white balance control. Thus, the green color in a light source, such as fluorescent light, is appropriately controlled to become an achromatic color.
Japanese Patent Application Laid-Open No. 05-64219 discusses determining whether the light source is indoor light or outdoor light based on the brightness of an object (or object illuminance). However, it is difficult to determine the light source using only the object illuminance. For example, since the illuminance of an object in the shade is low, the light source may be erroneously determined to be indoor light.
Furthermore, although Japanese Patent Application Laid-Open No. 08-79786 discusses extracting a green color signal from the color signals, the color of an object changes greatly depending on the white balance gain when feedback control is performed for adjusting white balance. Therefore, it is difficult to extract only the desired color signal.
The above-described problem will be discussed in detail below. FIGS. 16A and 16B each illustrate a green color region and a distribution of color signal data in a two-dimensional coordinate system in which a color-difference signal B′-Y is expressed along the abscissa and a color-difference signal R′-Y is expressed along the ordinate. R′ and B′ represent color signals that have been amplified according to the white balance gain. FIGS. 16A and 16B thus illustrate the distribution of color signal data that have been amplified with white balance control. FIGS. 16A and 16B include green color regions (green regions) 1700 and 1701 and distributions of color signal data 1702 and 1703, respectively.
In FIG. 16A, most of color signal data 1702 is included in the green region 1700. FIG. 16B illustrates the state after the white balance gain is changed from the state illustrated in FIG. 16A. In FIG. 16B, the signals determined as green in FIG. 16A are changed to be close to achromatic color signals, so that the green region 1701 does not include many color signal data 1703. Therefore, it is difficult to extract a green signal from the image signals of an object in the state illustrated in FIG. 16B.
As described above, since color signals that have been amplified with white balance control are detected when a feedback control is used for adjusting white balance, the color distribution of an object image changes according to the white balance gain. As a result, it may be difficult to extract a specific color signal, such as a green color signal, from the image signals of the object.